import requests from "./request"
import type { getGoodsType, getGoodsListType, mailItemType, backpackItemType } from "../types"
// 获取商品列表
export const getGoodsApi = (data: getGoodsType) => requests.get<any, getGoodsListType>("/goods", { params: data })
// 获取邮件列表
export const getmailApi = () => requests.get<any, mailItemType[]>("/mail")
// 领取邮件奖励物品
export const collectPrizesApi = (mailId: number) => requests.post<any, any>("/mail/collectPrizes", { mailId })
// 获取背包物品
export const getbackpackApi = () => requests.get<any, backpackItemType[]>("/backpack")
// 出售背包物品
export const sellbackpackApi = (articleId: number, sellNum: number) => requests.post<any, any>("/backpack/sell", { articleId, sellNum })
// 删除背包空物品
export const deletebackpackApi = (id: number) => requests.delete<any, any>(`/backpack/${id}`,)